package com.spring.theory.mvc.adapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;

/**
 * MyHandlerAdapter
 * - 间接调用 RequestMappingHandlerAdapter 受保护的 invokeHandlerMethod 方法
 *
 * @author H
 * @version 1.0
 * @date 2024-01-13 15:04
 */
public class MyRequestMappingHandlerAdapter extends RequestMappingHandlerAdapter {

    /**
     * 调用requestHandlerMapping在chain中封装好的handlerMethod，执行对应的方法
     */
    @Override
    public ModelAndView invokeHandlerMethod(HttpServletRequest request, HttpServletResponse response, HandlerMethod handlerMethod) throws Exception {
        return super.invokeHandlerMethod(request, response, handlerMethod);
    }
}
